<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>
<%@ page isELIgnored="false" %> 
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>

<%@ taglib uri="http://ckeditor.com" prefix="ckeditor" %>
<%@ taglib uri="http://www.demo.com/tag-el" prefix="demo" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/page" prefix="page" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<c:set var="datePattern"><fmt:message key="date.format"/></c:set>
<% //page language="java" errorPage="/error.jsp" pageEncoding="utf-8" contentType="text/html;charset=utf-8"  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<title>后台管理</title>
	<%@ include file="/WEB-INF/common/template/meta.jsp" %>
	<script type="text/javascript">
		$(document).ready(function(){
			$('.loginform button').hover(function(){
				$(this).stop().switchClass('default','hover');
			},function(){
				$(this).stop().switchClass('hover','default');
			});
			
			$('#login').submit(function(){
				var u = jQuery(this).find('#username');
				if(u.val() == '') {
					jQuery('.loginerror').slideDown();
					u.focus();
					return false;	
				}
			});
			
			$('#username').keypress(function(){
				jQuery('.loginerror').slideUp();
			});
			$('#password').keypress(function(){
				jQuery('.loginerror').slideUp();	
			});
			$('#changeImg').click(function() {
				var id = $(this).attr('for');
				// 默认图片加载
				var url = "<c:url value='/captcha/Jcaptcha_image.action' />";
	            var img = new Image();
				//设置图片地址
				img.src = url;
				img.onload = function() {
					var img = document.getElementById(id);
					img.src = url + '?' + new Date().getTime();
					img.style.visibility = "visible"; 
				};
			});
			// jQuery('.loginerror').slideDown();
		});
	</script>
	<!--[if lt IE 9]>
		<script src="http://css3-mediaqueries-js.googlecode.com/svn/trunk/css3-mediaqueries.js"></script>
	<![endif]-->
</head>
	<body class="login">
		<div class="loginbox radius3">
			<div class="loginboxinner radius3">
		    	<div class="loginheader">
		    		<h1 class="bebas">后台管理</h1>
		        	<div class="logo"><img src="<c:url value='/images/starlight_admin_template_logo.png'/>" alt="" /></div>
		    	</div><!--loginheader-->
		        
		        <div class="loginform">
		        	<div class="loginerror">
			        	<s:if test="hasActionErrors()">
					        <s:iterator value="actionErrors">
								<p><s:property/></p>
							</s:iterator>
						</s:if>
						
		        		<!-- <p>Invalid username or password</p> -->
		        	</div>
		        	<form id="login" action="<c:url value='/security_check'/>" method="post">
		            	<p>
		                	<label for="username" class="bebas">账号</label>
		                    <input type="text" id="username" name="j_username" class="radius2" />
		                </p>
		                <p>
		                	<label for="password" class="bebas">密码</label>
		                    <input type="password" id="password" name="j_password" class="radius2" />
		                </p>
    		            <p>
		                	<label for="password" class="bebas">验证码</label>
		                	<input type="text" style="vertical-align: bottom;width:80px;margin-right:6px;" name="captcha" />
		                	<img id="captcha" style="vertical-align: bottom; margin-right:6px;" src="<c:url value='/captcha/Jcaptcha_image.action' />"/>
		                	<a href="javascript:void(0);" class="whitelink small" id="changeImg" for="captcha">看不清，换一张</a>
		                </p>
		                <p>
		                	<button class="radius3 bebas">登    录</button>
		                </p>
		                <p><a href="javascript:alert('O(∩_∩)O')" class="whitelink small">无法使用您的账户?</a></p>
		            </form>
		        </div><!--loginform-->
		    </div><!--loginboxinner-->
		</div><!--loginbox-->
	</body>
</html>
